package br.unifor.ads.desphouse.ui;

import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JOptionPane;

public class PanelConfirmacao extends WindowAdapter {
	
	@Override
	public void windowClosing(WindowEvent arg0) {
		String ObjButtons[] = {"Sim","Não"};
	    int PromptResult = JOptionPane.showOptionDialog(arg0.getWindow(), 
	        "Atenção! Tem certeza que deseja sair?", "", 
	        JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE, null, 
	        ObjButtons,ObjButtons[1]);
	    if(PromptResult==0)
	    {
	      System.exit(0);          
	    }
	}
}
